<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        {{message}}
        <my-com></my-com>
    </div>
    <script>
        // 局部组件

        let MyComA = {
            template:"<h2>我是组件A</h2>"
        }


        let MyCom = {
            components:{
                MyComA
            },
            template: "<div><h1>我是mycom组件{{name}}</h1><my-com-a></my-com-a></div>",
            data: function () {
                return {
                    name: "张三"
                }
            }
        }


        new Vue({
            el: "#app",
            components: {
                MyCom
            },
            data: {
                message: "实例的数据"
            }
        })

    </script>
</body>

</html>